package com.jiaija;

/**
 * 强引用
 * @author : zjj
 * @date : 2022/5/7 10:49
 */
public class Demo04StrongReference {
    public static void main(String[] args) {
        StringBuffer str = new StringBuffer ("Hello,尚硅谷");
        StringBuffer str1 = str;

        str = null;
        System.gc();

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(str1);
    }
}
